Ubuntu 14.04
Sponsored Link

LDAP over TLS
2015/11/01
 
Configure LDAP over TLS to make connection be secure.
[1]
[2] Configure LDAP Server.
root@dlp:~#
cp /etc/ssl/private/server.key \
/etc/ssl/private/server.crt \
/etc/ssl/certs/ca-certificates.crt \
/etc/ldap/sasl2/

root@dlp:~#
chown openldap. /etc/ldap/sasl2/server.key \
/etc/ldap/sasl2/server.crt \
/etc/ldap/sasl2/ca-certificates.crt
root@dlp:~#
vi mod_ssl.ldif
# create new

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ldap/sasl2/ca-certificates.crt
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ldap/sasl2/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ldap/sasl2/server.key

root@dlp:~#
ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_ssl.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

root@dlp:~#
vi /etc/default/slapd
# line 24: add

SLAPD_SERVICES="ldap:/// ldapi:///
ldaps:///
"
root@dlp:~#
/etc/init.d/slapd restart

 * Stopping OpenLDAP slapd
   ...done.
 * Starting OpenLDAP slapd
   ...done.
[3] Configure LDAP Client for SSL connection.
root@www:~#
echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf

root@www:~#
vi /etc/ldap.conf
# line 261: uncomment

ssl start_tls
root@www:~#
logout
Ubuntu 14.04.3 LTS www.srv.world ttyS0
www login:
ubuntu

Password:
Last login: Tue Nov  3 00:45:45 JST 2015 on ttyS0
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-66-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
ubuntu@www:~$    
# just logined
 
Tweet